//
//  MapDetailCollectionViewCell.m
//  markmap
//
//  Created by 甘世清 on 2024/3/30.
//

#import "MapDetailCollectionViewCell.h"

@implementation MapDetailCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.layer.masksToBounds = YES;
        [self SQ_UIViewForSelfView];
    }
    return self;
}
/// 添加ui
-(void)SQ_UIViewForSelfView
{
    self.contentView.layer.cornerRadius = 10;
    self.contentView.clipsToBounds = YES;
    self.contentView.layer.masksToBounds = YES;
    UILabel * label = [[UILabel alloc]init];
    label.text = SQNSLocalString(@"查看更多\n照片");
    label.numberOfLines = 0;
    label.font = FONT_REGULAR(10);
    label.textAlignment = NSTextAlignmentCenter;
    label.textColor = UIColor.whiteColor;
    label.backgroundColor = SQColor999999;
    [self.contentView addSubview:label];
    [label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.contentView);
    }];
    [self.contentView addSubview:self.bgImage];
    [self.bgImage mas_makeConstraints:^(MASConstraintMaker *make) {
            make.edges.equalTo(self.contentView);
    }];
    
}
 
- (UIImageView *)bgImage{
    if (!_bgImage) {
        _bgImage = [[UIImageView alloc]init];
        _bgImage.clipsToBounds = YES;
        _bgImage.backgroundColor = UIColor.whiteColor;
        _bgImage.layer.cornerRadius = 4;
        _bgImage.layer.masksToBounds = YES;
        _bgImage.contentMode = UIViewContentModeScaleAspectFill;
        
    }
    return _bgImage;
}
@end
